package com.yycx.module.bus.provider.handler.process.handler;

import com.yycx.bpm.provider.base.AbstractProcInstDeleteService;
import com.yycx.common.mybatis.model.ResultBody;
import com.yycx.module.bus.provider.service.BusPaymentService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 资金支付流程实例删除
 */
@Component
public class PaymentProcInstanDeleteHandler extends AbstractProcInstDeleteService {
    @Resource
    private BusPaymentService paymentService;

    @Override
    public boolean support(String processDefinitionKey) {
        return processDefinitionKey.contains("payment_pay");
    }

    @Override
    public ResultBody success(String businessKey, String processInstanceId) {
        paymentService.clearProcessInstanceId(processInstanceId);
        return super.success(businessKey, processInstanceId);
    }
}
